//
//  StoreOtherTableViewCell.m
//  Shengzhuli
//
//  Created by subook on 16/8/12.
//  Copyright © 2016年 kamangkeji. All rights reserved.
//

#import "StoreOtherTableViewCell.h"
#import <UIButton+WebCache.h>

@interface StoreOtherTableViewCell()

@property (strong, nonatomic) IBOutlet UIButton *businessLicenseImageButton;
@property (strong, nonatomic) IBOutlet UIButton *taxRegistrationCertificateImageButton;
@property (strong, nonatomic) IBOutlet UIButton *placeBusinessImageButton;
@property (strong, nonatomic) IBOutlet UIButton *commitmentProtocolButton;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *imageWidthCons;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *imageHeightCons;

@end
@implementation StoreOtherTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    CGFloat width = (ScreenW-80)/4.0;
    self.imageWidthCons.constant = width;
    self.imageHeightCons.constant = width;
}

- (void)setModel:(SellerInfoModel *)model
{
    _model = model;
    if (model.businessLicense.length<1) return;
    [self.businessLicenseImageButton sd_setBackgroundImageWithURL:[NSURL URLWithString:model.businessLicense] forState:(UIControlStateNormal)];
    [self.taxRegistrationCertificateImageButton sd_setBackgroundImageWithURL:[NSURL URLWithString:model.taxRegistrationCertificate] forState:(UIControlStateNormal)];
    [self.placeBusinessImageButton sd_setBackgroundImageWithURL:[NSURL URLWithString:model.placeBusiness] forState:(UIControlStateNormal)];
    [self.commitmentProtocolButton sd_setBackgroundImageWithURL:[NSURL URLWithString:model.commitmentProtocol] forState:(UIControlStateNormal)];
}
- (IBAction)actionClick:(UIButton *)btn
{
    if (self.selectImageBlock) {
        self.selectImageBlock(btn);
    }
}

@end
